home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 7 / Apprentice-Release7.iso / Source Code / C / Applications / Moscow ML 1.42 / src / !runtime / gc.h < prev    next >
Encoding:
C/C++ Source or Header  |  1997-08-18  |  1.2 KB  |  43 lines  |  [TEXT/R*ch]

  1. #ifndef _gc_
  2. #define _gc_
  3.  
  4.  
  5. #include "mlvalues.h"
  6.  
  7. /* Defined in [major_gc.c]. */
  8. extern unsigned free_mem_percent_min, free_mem_percent_max;
  9.  
  10. #define White (0 << 8)
  11. #define Gray  (1 << 8)
  12. #define Blue  (2 << 8)
  13. #define Black (3 << 8)
  14.  
  15. #define Color_hd(hd) ((color_t) ((hd) & Black))
  16. #define Color_hp(hp) Color_hd (Hd_hp (hp))
  17.  
  18. #define Is_white_hd(hd) (Color_hd (hd) == White)
  19. #define Is_gray_hd(hd) (Color_hd (hd) == Gray)
  20. #define Is_blue_hd(hd) (Color_hd (hd) == Blue)
  21. #define Is_black_hd(hd) (Color_hd (hd) == Black)
  22.  
  23. #define Whitehd_hd(hd) ((hd) & ~Black)
  24. #define Grayhd_hd(hd) (((hd) & ~Black) | Gray)
  25. #define Blackhd_hd(hd) ((hd) | Black)
  26. #define Bluehd_hd(hd) (((hd) & ~Black) | Blue)
  27.  
  28. /* This depends on the layout of the header.  See [mlvalues.h]. */
  29. #define Make_header(wosize, tag, color)                          \
  30.        ((header_t) (((header_t) (wosize) << 10)                      \
  31.             + (color)                              \
  32.             + (tag_t) (tag)))
  33.  
  34. #define Color_val(val) (Color_hd (Hd_val (val)))
  35.  
  36. #define Is_white_val(val) (Color_val(val) == White)
  37. #define Is_gray_val(val) (Color_val(val) == Gray)
  38. #define Is_blue_val(val) (Color_val(val) == Blue)
  39. #define Is_black_val(val) (Color_val(val) == Black)
  40.  
  41.  
  42. #endif /* _gc_ */
  43.